Skip to content

feat(format): add formatters for Lua, Swift, Scala, Typst, and C##29257

Open
amirlankalm wants to merge 2 commits into
anomalyco:devfrom
amirlankalm:feat/add-missing-formatters
Open

feat(format): add formatters for Lua, Swift, Scala, Typst, and C##29257
amirlankalm wants to merge 2 commits into
anomalyco:devfrom
amirlankalm:feat/add-missing-formatters

Conversation

@amirlankalm
Copy link
Copy Markdown

@amirlankalm amirlankalm commented May 25, 2026

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds five formatters for languages already in the extension map but with no formatter support: stylua (Lua), swiftformat (Swift), scalafmt (Scala), typst fmt (Typst), and csharpier (C#).

Each follows the same binary-detection pattern as existing formatters like shfmt and gofmt. scalafmt additionally requires a .scalafmt.conf config file to activate, matching the ocamlformat pattern.

Also updates the formatter table in formatters.mdx with all five entries.

Note: this PR overlaps with #27728 which adds stylua only — this one is a superset. Happy to drop stylua here if the maintainers prefer to merge #27728 separately first.

How did you verify your code works?

  • Ran bun turbo typecheck — all 15 packages pass
  • Each formatter uses identical detection logic to existing ones (shfmt, gofmt, ocamlformat) so the same code paths are exercised
  • Verified stylua, swiftformat, and typst pick up correctly when the binary is in PATH

Screenshots / recordings

N/A — formatter-only change, no UI.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Add five formatters for languages that were already recognized in the
language extension map but had no formatter support:

- stylua (.lua) — formats Lua files, respects .stylua.toml if present
- swiftformat (.swift) — standard Swift formatter
- scalafmt (.scala) — requires .scalafmt.conf in project tree
- typst fmt (.typ, .typc) — built-in Typst formatter
- csharpier (.cs) — installed via dotnet-csharpier global tool
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found

PR #27728: feat(format): add stylua formatter for Lua files

  • This PR adds a stylua formatter specifically for Lua files
  • The current PR (feat(format): add formatters for Lua, Swift, Scala, Typst, and C# #29257) includes stylua as one of five formatters being added
  • Relation: The current PR appears to supersede or overlap with this earlier work, as it adds the same formatter (stylua) as part of a larger batch of formatter additions

This may indicate that either:

  1. PR feat(format): add stylua formatter for Lua files #27728 was previously attempted but not merged, and feat(format): add formatters for Lua, Swift, Scala, Typst, and C# #29257 addresses it as part of a broader formatter update
  2. The scope was expanded from a single formatter to multiple formatters
  3. There may be merge conflicts or duplicate effort to resolve

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant